<!--
Copyright Louis Dionne 2013-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
-->
<!-- boost-no-inspect -->
<!-- HTML header for doxygen 1.8.9.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<title>Boost.Hana: boost::mpl::list&lt; T &gt; Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
// Copyright Louis Dionne 2013-2017
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
MathJax.Hub.Config({
    "HTML-CSS": {
        linebreaks: {
            automatic: true,
            width: "75% container"
        }
    }
});
</script>
<script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<!-- Additional javascript for drawing charts. -->
<script type="text/javascript" src="highcharts.js"></script>
<script type="text/javascript" src="highcharts-data.js"></script>
<script type="text/javascript" src="highcharts-exporting.js"></script>
<script type="text/javascript" src="chart.js"></script>
<script type="text/javascript" src="hana.js"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Boost.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Boost.Hana
   &#160;<span id="projectnumber">1.7.1</span>
   </div>
   <div id="projectbrief">Your standard library for metaprogramming</div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.svg"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('structboost_1_1mpl_1_1list.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">boost::mpl::list&lt; T &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group__group-ext.html">External adapters</a> &raquo; <a class="el" href="group__group-ext-mpl.html">Boost.MPL adapters</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
<div class="textblock"><h3>template&lt;typename ... T&gt;<br />
struct boost::mpl::list&lt; T &gt;</h3>

<p>Adapter for Boost.MPL lists. </p>
<h2><a class="anchor" id="autotoc_md9"></a>
Modeled concepts</h2>
<p>It is possible for MPL lists to model a couple of concepts. However, because they are only able to hold types, they lack the generality required to model concepts like <code>Functor</code>, <code>Sequence</code> and other related concepts.</p>
<ol type="1">
<li><code>Comparable</code><br  />
Two MPL lists are equal if and only if they contain the same number of types, and if all those types are equal. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div>
<div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div>
<div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mpl_2list_8hpp.html">boost/hana/ext/boost/mpl/list.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="not__equal_8hpp.html">boost/hana/not_equal.hpp</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mpl_2list_8hpp.html">boost/mpl/list.hpp</a>&gt;</span></div>
<div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div>
<div class="line"><span class="keyword">namespace </span>mpl = boost::mpl;</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div>
<div class="line">    <a class="code" href="group__group-_comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">hana::equal</a>(mpl::list2&lt;int, char&gt;{}, mpl::list&lt;int, char&gt;{})</div>
<div class="line">);</div>
<div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div>
<div class="line">    <a class="code" href="group__group-_comparable.html#gae33be2e0d5e04f19082f4b7740dfc9cd">hana::not_equal</a>(mpl::list2&lt;int, char&gt;{}, mpl::list&lt;int, char, float&gt;{})</div>
<div class="line">);</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main() { }</div>
<div class="ttc" id="aassert_8hpp_html"><div class="ttname"><a href="assert_8hpp.html">assert.hpp</a></div><div class="ttdoc">Defines macros to perform different kinds of assertions.</div></div>
<div class="ttc" id="aequal_8hpp_html"><div class="ttname"><a href="equal_8hpp.html">equal.hpp</a></div><div class="ttdoc">Defines boost::hana::equal.</div></div>
<div class="ttc" id="agroup__group-_comparable_html_gacaf1ebea6b3ab96ac9dcb82f0e64e547"><div class="ttname"><a href="group__group-_comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">boost::hana::equal</a></div><div class="ttdeci">constexpr auto equal</div><div class="ttdoc">Returns a Logical representing whether x is equal to y.</div><div class="ttdef"><b>Definition:</b> equal.hpp:64</div></div>
<div class="ttc" id="agroup__group-_comparable_html_gae33be2e0d5e04f19082f4b7740dfc9cd"><div class="ttname"><a href="group__group-_comparable.html#gae33be2e0d5e04f19082f4b7740dfc9cd">boost::hana::not_equal</a></div><div class="ttdeci">constexpr auto not_equal</div><div class="ttdoc">Returns a Logical representing whether x is not equal to y.</div><div class="ttdef"><b>Definition:</b> not_equal.hpp:54</div></div>
<div class="ttc" id="agroup__group-assertions_html_ga2c5006540936d9f8880e3a39f4fcc035"><div class="ttname"><a href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a></div><div class="ttdeci">#define BOOST_HANA_CONSTANT_CHECK(...)</div><div class="ttdoc">Equivalent to BOOST_HANA_CONSTANT_ASSERT, but not influenced by the BOOST_HANA_CONFIG_DISABLE_ASSERTI...</div><div class="ttdef"><b>Definition:</b> assert.hpp:239</div></div>
<div class="ttc" id="ampl_2list_8hpp_html"><div class="ttname"><a href="mpl_2list_8hpp.html">list.hpp</a></div><div class="ttdoc">Adapts boost::mpl::list for use with Hana.</div></div>
<div class="ttc" id="anamespaceboost_1_1hana_html"><div class="ttname"><a href="namespaceboost_1_1hana.html">boost::hana</a></div><div class="ttdoc">Namespace containing everything in the library.</div><div class="ttdef"><b>Definition:</b> accessors.hpp:20</div></div>
<div class="ttc" id="anot__equal_8hpp_html"><div class="ttname"><a href="not__equal_8hpp.html">not_equal.hpp</a></div><div class="ttdoc">Defines boost::hana::not_equal.</div></div>
</div><!-- fragment --></li>
<li><code>Foldable</code><br  />
Folding a MPL list is equivalent to folding it as a <code>Sequence</code>. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div>
<div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div>
<div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mpl_2list_8hpp.html">boost/hana/ext/boost/mpl/list.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="ext_2std_2integral__constant_8hpp.html">boost/hana/ext/std/integral_constant.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="fold__left_8hpp.html">boost/hana/fold_left.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="if_8hpp.html">boost/hana/if.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="plus_8hpp.html">boost/hana/plus.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mpl_2list_8hpp.html">boost/mpl/list.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;type_traits&gt;</span></div>
<div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div>
<div class="line"><span class="keyword">namespace </span>mpl = boost::mpl;</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="keyword">auto</span> types = mpl::list&lt;long, float, short, float, long, long double&gt;{};</div>
<div class="line"><span class="keyword">auto</span> number_of_floats = hana::fold_left(types, hana::int_c&lt;0&gt;, [](<span class="keyword">auto</span> <a class="code" href="group__group-_foldable.html#ga3159cfa41be18a396926741b0a3fdefd">count</a>, <span class="keyword">auto</span> t) {</div>
<div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group-_logical.html#gafd655d2222367131e7a63616e93dd080">hana::if_</a>(hana::trait&lt;std::is_floating_point&gt;(t),</div>
<div class="line">        <a class="code" href="group__group-_foldable.html#ga3159cfa41be18a396926741b0a3fdefd">count</a> + hana::int_c&lt;1&gt;,</div>
<div class="line">        <a class="code" href="group__group-_foldable.html#ga3159cfa41be18a396926741b0a3fdefd">count</a></div>
<div class="line">    );</div>
<div class="line">});</div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(number_of_floats == hana::int_c&lt;3&gt;);</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main() { }</div>
<div class="ttc" id="aext_2std_2integral__constant_8hpp_html"><div class="ttname"><a href="ext_2std_2integral__constant_8hpp.html">integral_constant.hpp</a></div><div class="ttdoc">Adapts std::integral_constant for use with Hana.</div></div>
<div class="ttc" id="afold__left_8hpp_html"><div class="ttname"><a href="fold__left_8hpp.html">fold_left.hpp</a></div><div class="ttdoc">Defines boost::hana::fold_left.</div></div>
<div class="ttc" id="agroup__group-_foldable_html_ga3159cfa41be18a396926741b0a3fdefd"><div class="ttname"><a href="group__group-_foldable.html#ga3159cfa41be18a396926741b0a3fdefd">boost::hana::count</a></div><div class="ttdeci">constexpr auto count</div><div class="ttdoc">Return the number of elements in the structure that compare equal to a given value.</div><div class="ttdef"><b>Definition:</b> count.hpp:41</div></div>
<div class="ttc" id="agroup__group-_logical_html_gafd655d2222367131e7a63616e93dd080"><div class="ttname"><a href="group__group-_logical.html#gafd655d2222367131e7a63616e93dd080">boost::hana::if_</a></div><div class="ttdeci">constexpr auto if_</div><div class="ttdoc">Conditionally return one of two values based on a condition.</div><div class="ttdef"><b>Definition:</b> if.hpp:41</div></div>
<div class="ttc" id="aif_8hpp_html"><div class="ttname"><a href="if_8hpp.html">if.hpp</a></div><div class="ttdoc">Defines boost::hana::if_.</div></div>
<div class="ttc" id="aintegral__constant_8hpp_html"><div class="ttname"><a href="integral__constant_8hpp.html">integral_constant.hpp</a></div><div class="ttdoc">Defines boost::hana::integral_constant.</div></div>
<div class="ttc" id="aplus_8hpp_html"><div class="ttname"><a href="plus_8hpp.html">plus.hpp</a></div><div class="ttdoc">Defines boost::hana::plus.</div></div>
<div class="ttc" id="atype_8hpp_html"><div class="ttname"><a href="type_8hpp.html">type.hpp</a></div><div class="ttdoc">Defines boost::hana::type and related utilities.</div></div>
</div><!-- fragment --></li>
<li><code>Iterable</code><br  />
Iterating over a MPL list is just iterating over each of the types it contains, as if it were a <code>Sequence</code>. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div>
<div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div>
<div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="drop__front_8hpp.html">boost/hana/drop_front.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="drop__while_8hpp.html">boost/hana/drop_while.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mpl_2list_8hpp.html">boost/hana/ext/boost/mpl/list.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="ext_2std_2integral__constant_8hpp.html">boost/hana/ext/std/integral_constant.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="front_8hpp.html">boost/hana/front.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mpl_2list_8hpp.html">boost/mpl/list.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;type_traits&gt;</span></div>
<div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div>
<div class="line"><span class="keyword">namespace </span>mpl = boost::mpl;</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-_iterable.html#ga8a67ea10e8082dbe6705e573fa978444">hana::front</a>(mpl::list&lt;int, char, void&gt;{}) == hana::type_c&lt;int&gt;);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-_comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">hana::equal</a>(</div>
<div class="line">    <a class="code" href="group__group-_iterable.html#gad23ce0a4906e2bb0a52f38837b134757">hana::drop_front</a>(mpl::list&lt;int, char, void&gt;{}),</div>
<div class="line">    mpl::list&lt;char, void&gt;{}</div>
<div class="line">));</div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-_comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">hana::equal</a>(</div>
<div class="line">    <a class="code" href="group__group-_iterable.html#ga9f1d02c74a6bdc1db260e0d6a8f1ee56">hana::drop_while</a>(mpl::list&lt;float, double const, int, float&amp;&gt;{},</div>
<div class="line">                     hana::trait&lt;std::is_floating_point&gt;),</div>
<div class="line">    mpl::list&lt;int, float&amp;&gt;{}</div>
<div class="line">));</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main() { }</div>
<div class="ttc" id="adrop__front_8hpp_html"><div class="ttname"><a href="drop__front_8hpp.html">drop_front.hpp</a></div><div class="ttdoc">Defines boost::hana::drop_front.</div></div>
<div class="ttc" id="adrop__while_8hpp_html"><div class="ttname"><a href="drop__while_8hpp.html">drop_while.hpp</a></div><div class="ttdoc">Defines boost::hana::drop_while.</div></div>
<div class="ttc" id="afront_8hpp_html"><div class="ttname"><a href="front_8hpp.html">front.hpp</a></div><div class="ttdoc">Defines boost::hana::front.</div></div>
<div class="ttc" id="agroup__group-_iterable_html_ga8a67ea10e8082dbe6705e573fa978444"><div class="ttname"><a href="group__group-_iterable.html#ga8a67ea10e8082dbe6705e573fa978444">boost::hana::front</a></div><div class="ttdeci">constexpr auto front</div><div class="ttdoc">Returns the first element of a non-empty iterable.</div><div class="ttdef"><b>Definition:</b> front.hpp:32</div></div>
<div class="ttc" id="agroup__group-_iterable_html_ga9f1d02c74a6bdc1db260e0d6a8f1ee56"><div class="ttname"><a href="group__group-_iterable.html#ga9f1d02c74a6bdc1db260e0d6a8f1ee56">boost::hana::drop_while</a></div><div class="ttdeci">constexpr auto drop_while</div><div class="ttdoc">Drop elements from an iterable up to, but excluding, the first element for which the predicate is not...</div><div class="ttdef"><b>Definition:</b> drop_while.hpp:44</div></div>
<div class="ttc" id="agroup__group-_iterable_html_gad23ce0a4906e2bb0a52f38837b134757"><div class="ttname"><a href="group__group-_iterable.html#gad23ce0a4906e2bb0a52f38837b134757">boost::hana::drop_front</a></div><div class="ttdeci">constexpr auto drop_front</div><div class="ttdoc">Drop the first n elements of an iterable, and return the rest.</div><div class="ttdef"><b>Definition:</b> drop_front.hpp:47</div></div>
</div><!-- fragment --></li>
<li><code>Searchable</code><br  />
A MPL list can be searched as if it were a tuple containing <code><a class="el" href="structboost_1_1hana_1_1type.html" title="C++ type in value-level representation.">hana::type</a></code>s. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div>
<div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div>
<div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mpl_2list_8hpp.html">boost/hana/ext/boost/mpl/list.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="find_8hpp.html">boost/hana/find.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="find__if_8hpp.html">boost/hana/find_if.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="optional_8hpp.html">boost/hana/optional.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mpl_2list_8hpp.html">boost/mpl/list.hpp</a>&gt;</span></div>
<div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div>
<div class="line"><span class="keyword">namespace </span>mpl = boost::mpl;</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div>
<div class="line">    <a class="code" href="group__group-_searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">hana::find_if</a>(mpl::list&lt;int, float, char const*&gt;{}, <a class="code" href="group__group-_comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">hana::equal</a>.to(hana::type_c&lt;float&gt;))</div>
<div class="line">    ==</div>
<div class="line">    hana::just(hana::type_c&lt;float&gt;)</div>
<div class="line">);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div>
<div class="line">    <a class="code" href="group__group-_searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">hana::find</a>(mpl::list&lt;int, float, char const*&gt;{}, hana::type_c&lt;void&gt;)</div>
<div class="line">    ==</div>
<div class="line">    hana::nothing</div>
<div class="line">);</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main() { }</div>
<div class="ttc" id="afind_8hpp_html"><div class="ttname"><a href="find_8hpp.html">find.hpp</a></div><div class="ttdoc">Defines boost::hana::find.</div></div>
<div class="ttc" id="afind__if_8hpp_html"><div class="ttname"><a href="find__if_8hpp.html">find_if.hpp</a></div><div class="ttdoc">Defines boost::hana::find_if.</div></div>
<div class="ttc" id="agroup__group-_searchable_html_ga6b6cdd69942b0fe3bf5254247f9c861e"><div class="ttname"><a href="group__group-_searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">boost::hana::find</a></div><div class="ttdeci">constexpr auto find</div><div class="ttdoc">Finds the value associated to the given key in a structure.</div><div class="ttdef"><b>Definition:</b> find.hpp:44</div></div>
<div class="ttc" id="agroup__group-_searchable_html_ga7f99b80672aa80a7eb8b223955ce546f"><div class="ttname"><a href="group__group-_searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">boost::hana::find_if</a></div><div class="ttdeci">constexpr auto find_if</div><div class="ttdoc">Finds the value associated to the first key satisfying a predicate.</div><div class="ttdef"><b>Definition:</b> find_if.hpp:41</div></div>
<div class="ttc" id="aoptional_8hpp_html"><div class="ttname"><a href="optional_8hpp.html">optional.hpp</a></div><div class="ttdoc">Defines boost::hana::optional.</div></div>
</div><!-- fragment --></li>
</ol>
<h2><a class="anchor" id="autotoc_md10"></a>
Conversion from any &lt;tt&gt;Foldable&lt;/tt&gt;</h2>
<p>A MPL list can be created from any <code>Foldable</code>. More precisely, for a <code>Foldable</code> <code>xs</code> whose linearization is <code>[x1, ..., xn]</code>, </p><div class="fragment"><div class="line">to&lt;ext::boost::mpl::list_tag&gt;(xs) == mpl::list&lt;t1, ..., tn&gt;{}</div>
</div><!-- fragment --><p> where <code>tk</code> is the type of <code>xk</code>, or the type contained in <code>xk</code> if <code>xk</code> is a <code><a class="el" href="structboost_1_1hana_1_1type.html" title="C++ type in value-level representation.">hana::type</a></code>. </p><dl class="section warning"><dt>Warning</dt><dd>The limitations on the size of <code><a class="el" href="structboost_1_1mpl_1_1list.html" title="Adapter for Boost.MPL lists.">mpl::list</a></code>s are inherited by this conversion utility, and hence trying to convert a <code>Foldable</code> containing more than <a href="http://www.boost.org/doc/libs/release/libs/mpl/doc/refmanual/limit-list-size.html">BOOST_MPL_LIMIT_LIST_SIZE</a> elements is an error. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div>
<div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div>
<div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="core_2to_8hpp.html">boost/hana/core/to.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mpl_2list_8hpp.html">boost/hana/ext/boost/mpl/list.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mpl_2list_8hpp.html">boost/mpl/list.hpp</a>&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;type_traits&gt;</span></div>
<div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div>
<div class="line"><span class="keyword">namespace </span>mpl = boost::mpl;</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="keyword">auto</span> xs = hana::make_tuple(hana::type_c&lt;int&gt;, hana::type_c&lt;char&gt;, hana::type_c&lt;double&gt;);</div>
<div class="line">static_assert(std::is_same&lt;</div>
<div class="line">    decltype(hana::to&lt;hana::ext::boost::mpl::list_tag&gt;(xs)),</div>
<div class="line">    mpl::list&lt;int, char, double&gt;</div>
<div class="line">&gt;{}, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main() { }</div>
<div class="ttc" id="acore_2to_8hpp_html"><div class="ttname"><a href="core_2to_8hpp.html">to.hpp</a></div><div class="ttdoc">Defines boost::hana::to and related utilities.</div></div>
<div class="ttc" id="atuple_8hpp_html"><div class="ttname"><a href="tuple_8hpp.html">tuple.hpp</a></div><div class="ttdoc">Defines boost::hana::tuple.</div></div>
</div><!-- fragment --> </dd></dl>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!--
Copyright Louis Dionne 2013-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
-->
<!-- boost-no-inspect -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>boost</b></li><li class="navelem"><b>mpl</b></li><li class="navelem"><a class="el" href="structboost_1_1mpl_1_1list.html">list</a></li>
  </ul>
</div>
</body>
</html>
